﻿<Window x:Class="SampleApp.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="MainWindow" Height="350" Width="525">
    <DockPanel LastChildFill="True">
        <Grid DockPanel.Dock="Top" >
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>
            <Label Content="Given Name:" Grid.Column="0" />
            <TextBox Grid.Column="1" Text="{Binding GivenName, UpdateSourceTrigger=PropertyChanged}" />
            <Label Content="Family Name:" Grid.Column="2" />
            <TextBox Grid.Column="3" Text="{Binding FamilyName, UpdateSourceTrigger=PropertyChanged}" />
            <TextBlock Grid.Column="4" HorizontalAlignment="Center" FontWeight="Bold" Text="{Binding SearchStatus}" />
        </Grid>
        <DockPanel Grid.IsSharedSizeScope="True" LastChildFill="True">
            <Grid Margin="33,15,15,0" ShowGridLines="True" DockPanel.Dock="Top" HorizontalAlignment="Left">
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"/>
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition SharedSizeGroup="GivenName" />
                    <ColumnDefinition SharedSizeGroup="FamilyName" />
                    <ColumnDefinition SharedSizeGroup="Email" />
                    <ColumnDefinition SharedSizeGroup="PhoneNumber" />
                </Grid.ColumnDefinitions>
                <TextBlock Text="Given Name" HorizontalAlignment="Center" Grid.Row ="0" Grid.Column="0" Margin="10,2,10,2"/>
                <TextBlock Text="Family Name" HorizontalAlignment="Center" Grid.Row ="0" Grid.Column="1"  Margin="10,2,10,2"/>
                <TextBlock Text="Email" HorizontalAlignment="Center" Grid.Row ="0" Grid.Column="2"  Margin="10,2,10,2"/>
                <TextBlock Text="Phone" HorizontalAlignment="Center" Grid.Row ="0" Grid.Column="3"  Margin="10,2,10,2"/>
            </Grid>
            <ListBox Margin="15,0,15,15" ItemsSource="{Binding PeopleResults}">
                <ListBox.ItemTemplate>
                    <DataTemplate>
                        <Grid ShowGridLines="True">
                            <Grid.RowDefinitions>
                                <RowDefinition />
                            </Grid.RowDefinitions>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition SharedSizeGroup="GivenName" />
                                <ColumnDefinition SharedSizeGroup="FamilyName" />
                                <ColumnDefinition SharedSizeGroup="Email" />
                                <ColumnDefinition SharedSizeGroup="PhoneNumber" />
                            </Grid.ColumnDefinitions>
                            <TextBlock Text="{Binding Firstname}" HorizontalAlignment="Center" Grid.Row ="0" Grid.Column="0"  Margin="0,2,10,2" />
                            <TextBlock Text="{Binding Surname}" HorizontalAlignment="Center" Grid.Row ="0" Grid.Column="1"  Margin="10,2,10,2" />
                            <TextBlock Text="{Binding Email}" HorizontalAlignment="Center" Grid.Row ="0" Grid.Column="2" Margin="10,2,10,2" />
                            <TextBlock Text="{Binding Phone}" HorizontalAlignment="Center" Grid.Row ="0" Grid.Column="3"  Margin="10,2,10,2" />
                        </Grid>
                    </DataTemplate>
                </ListBox.ItemTemplate>
            </ListBox>
        </DockPanel>
    </DockPanel>
</Window>
